#ifndef __MOUSE_H
#define __MOUSE_H

#include <input.h>
#include <stdio_dev.h>

/**
 * struct mouse_priv - information about a mouse, for the uclass
 *
 * @sdev:	stdio device
 * @input:	input configuration (the driver may use this if desired)
 */
struct mouse_priv {
	struct stdio_dev sdev;

	/*
	 * This is set up by the uclass but will only be used if the driver
	 * sets input.dev to its device pointer (it is initially NULL).
	 */
	struct input_config input;
};

/**
 * struct mouse_ops - mouse device operations
 */
struct mouse_ops {
	/**
	 * start() - enable the mouse ready for use
	 *
	 * @dev:	Device to enable
	 * @return 0 if OK, -ve on error
	 */
	int (*start)(struct udevice *dev);

	/**
	 * stop() - disable the mouse when no-longer needed
	 *
	 * @dev:	Device to disable
	 * @return 0 if OK, -ve on error
	 */
	int (*stop)(struct udevice *dev);

	/**
	 * tstc() - check if a mouse event is available
	 *
	 * @dev:	Device to check
	 * @return 0 if no event is available, 1 if an event is available, -ve on
	 *	   error
	 */
	int (*tstc)(struct udevice *dev);

	/**
	 * getc() - get a mouse event
	 *
	 * @dev:	Device to read from
	 * @return -EAGAIN if no event is available, otherwise event value read
	 *	   (as a struct mouse_event).
	 */
	int (*getc)(struct udevice *dev);
};

#define mouse_get_ops(dev)	((struct mouse_ops *)(dev)->driver->ops)

// #else

// extern int mouse_init (void);
// extern void handle_mouse_event(unsigned char event);
// extern int mouse_init_hw(void);
// extern void ps2mouse_leds(unsigned char leds);


#endif /* __MOUSE_H */
